import Vue from 'vue'
import Login from '@/components/Login'
import Main from '@/components/Main'


/**
 * routes==默认路由节点
 */
export const loginRouter = {
    path: '/login',
    name: 'Login', //登录
    component: Login,
    hidden: true

}
export const dataRouter = [


];
export const otherRouter = {

}
export const appRouter = [{
        path: '/',
        name: 'MainIndex',
        redirect: '/index',
        component: Main,
        icon: "el-icon-menu",
        hidden: false,
        title: "首页",
        children: [{
            path: 'index',
            hidden: false,
            component: resolve => { require(['@/components/Index.vue'], resolve) },
            name: "Index",
            title: "工作台"
        }]
    },


    {
        path: '/merchant',
        title: "账户信息", //登录
        hidden: true,
        name: 'Merchant',
        icon: "el-icon-user",
        component: Main,
        children: [{
            title: '个人信息',
            path: 'info',
            hidden: true,
            component: resolve => { require(['@/components/User/Info.vue'], resolve) },
            name: "UserInfo",
        }, {
            title: "修改密码",
            name: "Password",
            hidden: true,
            path: 'pwd',
            component: resolve => { require(['@/components/User/Password.vue'], resolve) }
        }, {
            title: "企业微信",
            name: "WxWork",
            hidden: true,
            path: 'wxwork',
            component: resolve => { require(['@/components/User/WxWork.vue'], resolve) }
        }, {
            title: "微信绑定",
            name: "Weixin",
            hidden: true,
            path: 'weixin',
            component: resolve => { require(['@/components/User/Weixin.vue'], resolve) }
        }]

    },
    {
        path: '/',
        title: "系统设置", //登录
        name: "SysSet", //登录
        hidden: false,
        icon: "el-icon-setting",
        component: Main,
        children: [{
                hidden: false,
                title: '基本设置',
                path: '/base/set',
                component: resolve => { require(['@/components/Set/Info.vue'], resolve) },
                name: "BaseSet",
            }, {
                hidden: false,
                title: '发货地址',
                path: '/base/address',
                component: resolve => { require(['@/components/Set/SysAddress.vue'], resolve) },
                name: "SysAddress",
            }, {
                hidden: false,
                title: '发货地址项目',
                path: '/base/address/pm',
                component: resolve => { require(['@/components/Set/PmSysAddress.vue'], resolve) },
                name: "PmSysAddress",
            }, {
                hidden: false,
                title: "微信设置",
                name: "ShopWxEdit",
                path: '/shopwx/edit',
                component: resolve => {
                    require(['@/components/ShopWx/ShopWxEdit.vue'],
                        resolve)
                }
            },
            {
                hidden: false,
                title: "企业微信设置",
                name: "WorkWxEdit",
                path: '/workwx/edit',
                component: resolve => {
                    require(['@/components/ShopWx/WorkWxEdit.vue'],
                        resolve)
                }
            },

            {
                hidden: true,
                title: '短信设置',
                name: "SmsSet",
                path: '/base/sms',
                component: resolve => { require(['@/components/Set/SysSms.vue'], resolve) }
            },
            {
                hidden: false,
                title: '操作日志',
                name: "SysRequestLogsList",
                path: '/sys/logs',
                component: resolve => { require(['@/components/SysLogs/SysRequestLogsList.vue'], resolve) }
            },
            {
                hidden: false,
                title: "清除数据",
                name: "ClearData",
                path: '/sysconfig/cleardata',
                component: resolve => { require(['@/components/Set/ClearData.vue'], resolve) }
            }, {
                hidden: true,
                title: "系统通知",
                name: "Notification",
                path: 'notification',
                component: resolve => { require(['@/components/Notification/Notification.vue'], resolve) }
            },
            {
                path: '/wxmenu/list',
                title: "自定义菜单",
                name: 'WxMenuList',
                component: resolve => { require(['@/components/WxMenu/WxMenuList.vue'], resolve) }
            },
            {
                path: '/wxmenu/add',
                title: "自定义菜单添加",
                name: 'WxMenuAdd',
                component: resolve => { require(['@/components/WxMenu/WxMenuEdit.vue'], resolve) }
            },
            {
                path: '/wxmenu/edit/:wxMenuId',
                title: "自定义菜单修改",
                name: 'WxMenuEdit',
                component: resolve => { require(['@/components/WxMenu/WxMenuEdit.vue'], resolve) }
            },
            {
                path: '/wxmsgreply/list',
                title: "关键字回复",
                name: 'WxMsgReplyList',
                component: resolve => { require(['@/components/WxMsgReply/WxMsgReplyList.vue'], resolve) }
            },
            {
                path: '/wxmsgreply/add',
                title: "关键字回复添加",
                name: 'WxMsgReplyAdd',
                component: resolve => { require(['@/components/WxMsgReply/WxMsgReplyEdit.vue'], resolve) }
            },
            {
                path: '/wxmsgreply/edit/:wxMsgReplyId',
                title: "关键字回复修改",
                name: 'WxMsgReplyEdit',
                component: resolve => { require(['@/components/WxMsgReply/WxMsgReplyEdit.vue'], resolve) }
            }
        ]

    }, {
        path: '/',
        name: 'SysUser',
        component: Main,
        hidden: false,
        icon: "el-icon-setting",
        title: "用户/角色",
        children: [{
            hidden: false,
            path: '/sysuser/list',
            component: resolve => { require(['@/components/SysUser/SysUserList.vue'], resolve) },
            name: "SysUserList",
            title: "用户管理"
        }, {
            hidden: false,
            path: '/deparment/list',
            component: resolve => { require(['@/components/SysDepartment/SysDepartmentList.vue'], resolve) },
            name: "SysDepartmentList",
            title: "部门组织"
        }, {
            hidden: false,
            path: '/sysrole/list',
            component: resolve => { require(['@/components/SysRole/SysRoleList.vue'], resolve) },
            name: "SysRoleList",
            title: "角色管理"
        }, {
            hidden: false,
            path: '/sysmenu/list',
            component: resolve => { require(['@/components/SysRole/SysMenuList.vue'], resolve) },
            name: "SysMenuList",
            title: "菜单管理"
        }, {
            hidden: true,
            title: "菜单添加",
            name: "SysMenuAdd",
            path: '/sysmenu/add',
            component: resolve => { require(['@/components/SysRole/SysMenuEdit.vue'], resolve) }
        }, {
            hidden: true,
            title: "菜单修改",
            name: "SysMenuEdit",
            path: '/sysmenu/edit/:sysMenuId',
            component: resolve => { require(['@/components/SysRole/SysMenuEdit.vue'], resolve) }
        }]
    },



    {
        path: '/',
        name: 'Customer',
        component: Main,
        hidden: false,
        title: "客户管理",
        icon: "el-icon-s-custom",
        children: [{
            hidden: false,
            path: '/customer/list',
            component: resolve => { require(['@/components/Customer/CustomerList.vue'], resolve) },
            name: "CustomerList",
            title: "客户管理"
        }]
    },
    {
        path: '/',
        name: 'SaleOrder',
        component: Main,
        hidden: false,
        title: "送货单管理",
        icon: "el-icon-s-custom",
        children: [{
            hidden: false,
            path: '/saleorder/list',
            component: resolve => { require(['@/components/SaleOrder/SaleOrderList.vue'], resolve) },
            name: "SaleOrderList",
            title: "送货单管理"
        }]
    },
    {
        path: '/',
        name: 'fahuofuhe',
        component: Main,
        hidden: false,
        title: "发货复核",
        icon: "el-icon-s-custom",
        children: [{
            path: 'fahuo',
            hidden: true,
            component: resolve => { require(['@/components/Outgo.vue'], resolve) },
            name: "Outgo",
            title: "订单复核"
        }]
    }
]

export const routers = [
    loginRouter,
    ...dataRouter,
    ...appRouter
];